program vidu1;

{$ifdef windows}
{$APPTYPE CONSOLE}
{$endif}

uses
  SysUtils;

const
  MagicValue = 65;

procedure Welcome;
  var k: integer;
  begin
    for k:=5 downto 1 do writeln(('Welcome to Delphi'))
  end;

var
  ValueCode :                      byte;
  Kytu :                           char;
  i :                              byte;
  Dai, Rong, Average, Product :    real;
  a, n :                           integer;
  
begin
  Welcome;
  write('Nhap chieu dai va chieu rong: ');
  readln(Dai, Rong);
  Average := (Dai + Rong)*2;
  Product := Dai*Rong;
  writeln('chu vi = ' + FloatToStr(Average));
  writeln('Dien tich = '+ FloatToStr(Product));

  ValueCode := byte('A');
  writeln('Gia tri ma ASCII cua ky tu A la: '+ IntToStr(ValueCode));

  byte(Kytu) := MagicValue;
  writeln('Ky tu cua gia tri ma 65 la: '+Kytu);
  writeln('------Bang Ma Cac Ky Tu ASCII--------');
  for i:=0 to 255 do write(chr(i):4);

  write('Nhap a va n: ');
  readln(a, n);

  (*function tong(a: integer): extended;
  var t: integer;
  begin
  for t:=1 to a do tong:=tong+t
  end;    *)

  readln;
  { TODO -oUser -cConsole Main : Insert code here }
end.

